﻿<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:Avanade="urn:Avanade" xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
  <xsl:output method="html" version="4.0" encoding="iso-8859-1" indent="yes"/>
  <xsl:template match="/">

    <table width="100%" border="0" cellspacing="0" cellpadding="0" summary="Webpart ANNONCE">
      <xsl:for-each select="xml/rs:data/z:row">
        <xsl:sort select="current()/@ows_Created" order="descending" />
        <xsl:if test="normalize-space(//EditFormURL) != ''">
          <tr>
            <td class="ms-addnew" style="background-color:#ffffff;width:100%;vertical-align:top;height:0%;padding:10px;font-size:10px;">
              <![CDATA[<img alt="" src="_layouts/images/rect.gif" />&nbsp;<a class="ms-addnew" href="]]><xsl:value-of select="//EditFormURL" /><![CDATA[">Modifier cette annonce</a>]]>
            </td>
          </tr>
        </xsl:if>
        <tr>
          <td style="background-color:#ffffff;width:100%;vertical-align:top;height:0%;padding:10px;font-size:10px;">
            <div id="artPage3" class="bloc_item" style="display: block;">
              <div class="item_title" style="display: inline-block;">
                <xsl:value-of select="current()/@ows_Surtitre" />
              </div>
              <H2>
                <span class="highlight title">
                  <xsl:value-of select="current()/@ows_Title" />
                </span>
              </H2>

              <xsl:if test="/xml/Like != 'Inactif'">
                <div class="item_title">
                  <span class="item-like">
                    <xsl:if test="current()/@ows_Titre_x0020__x002d__x0020_eng != ''">
                      <div style="float:left;border-style: solid;border-width: 2px;padding: 1px 8px 1px 8px;color: #f21e8c;display: inline;margin-right: 10px;position: relative;">
                        <a href="javascript:ChangeVersion();">English version</a>
                      </div>
                    </xsl:if>
                    <img src="/_layouts/15/VPLink2013/images/picto_like.jpg" height="17" width="19"/>
                    <p>
                      <xsl:value-of select="/xml/NbLike"/>
                    </p>
                    <xsl:if test="not(/xml/UserCrtLike = 'OK')">
                      <span class="item-like_text">
                        <a href="javascript:JAime();">j'aime</a>
                      </span>
                    </xsl:if>
                    <xsl:if test="/xml/LikeProcessed = 'OK'">
                      <span class="item-like_text" style="color:#4f4f4f">
                        Like enregistré
                      </span>
                    </xsl:if>
                    <xsl:if test="/xml/Comments">
                      <span style="margin-left:3px">
                        <xsl:choose>
                          <xsl:when test="/xml/Comments = '1' or /xml/Comments = '0'">
                            <p>
                              <xsl:value-of select="/xml/Comments"/> Commentaire
                            </p>
                          </xsl:when>
                          <xsl:otherwise>
                            <p>
                              <xsl:value-of select="/xml/Comments"/> Commentaires
                            </p>
                          </xsl:otherwise>
                        </xsl:choose>
                      </span>
                    </xsl:if>
                  </span>
                </div>
                <input type="hidden" name="MyAction" value=""/>
                <input type="hidden" name="Version" value=""/>
                <script language="javascript">
                  function JAime()
                  {
                  var frm = document.forms[0];
                  frm.MyAction.value = "jaime";
                  frm.submit();
                  }
                  function ChangeVersion()
                  {
                  var frm = document.forms[0];
                  frm.Version.value = "En";
                  frm.submit();
                  }
                </script>
              </xsl:if>

              <div class="item_container">
                <div class="item_description">
                  <xsl:if test="current()/@ows_Date_x0020_publication">
                    <div style="font-family:'vp_sansregular',Arial;font-size:10pt;font-weight:bold;color:#4f4f4f;">
                      <xsl:value-of select="Avanade:FormatDate(current()/@ows_Date_x0020_publication)" />
                    </div>
                  </xsl:if>

                  <div class="item_content" style="display: inline-block;">
                    <xsl:if test="normalize-space(translate(current()/@ows_Photo2, ',', '')) != ''">
                      <div style="float:left;padding-right:10px">
                        <img style="border: solid 1px #fce4ee;">
                          <xsl:attribute name="src">
                            <xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo2)" />
                          </xsl:attribute>
                        </img>
                      </div>
                    </xsl:if>
                    <div style="font-family:'vp_sansregular',Arial;font-size:10pt;font-weight:bold;color:#4f4f4f;">
                      <xsl:value-of select="current()/@ows_Chapeau" />
                    </div>
                    <br/>
                    <xsl:if test="/xml/ImageDroite01 or /xml/ImageDroite02 or /xml/ImageDroite03 or /xml/ImageDroite04 or /xml/ImageDroite05">
                      <table width="100%" align="center" cellpadding="2">
                        <tr>
                          <td width="80%" valign="top">
                            <div style="font-family:Arial;font-size:10pt;color:#4f4f4f;padding-right:10px;">
                              <xsl:value-of select="current()/@ows_Body" />
                            </div>
                          </td>
                          <td width="20%" valign="top">
                            <table width="100%" align="center">
                              <tr>
                                <xsl:if test="/xml/ImageDroite01">
                                  <td>
                                    <img border="0" src="{/xml/ImageDroite01}" style="margin: 0 0 6px 6px"/>
                                  </td>
                                </xsl:if>
                              </tr>
                              <tr>
                                <xsl:if test="/xml/ImageDroite02">
                                  <td>
                                    <img border="0" src="{/xml/ImageDroite02}" style="margin: 0 0 6px 6px"/>
                                  </td>
                                </xsl:if>
                              </tr>
                              <tr>
                                <xsl:if test="/xml/ImageDroite03">
                                  <td>
                                    <img border="0" src="{/xml/ImageDroite03}" style="margin: 0 0 6px 6px"/>
                                  </td>
                                </xsl:if>
                              </tr>
                              <tr>
                                <xsl:if test="/xml/ImageDroite04">
                                  <td>
                                    <img border="0" src="{/xml/ImageDroite04}" style="margin: 0 0 6px 6px"/>
                                  </td>
                                </xsl:if>
                              </tr>
                              <tr>
                                <xsl:if test="/xml/ImageDroite05">
                                  <td>
                                    <img border="0" src="{/xml/ImageDroite05}" style="margin: 0 0 6px 6px"/>
                                  </td>
                                </xsl:if>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </xsl:if>
                    <xsl:if test="not(/xml/ImageDroite01 or /xml/ImageDroite02 or /xml/ImageDroite03 or /xml/ImageDroite04 or /xml/ImageDroite05)">
                      <div style="font-family:Arial;font-size:10pt;color:#4f4f4f">
                        <xsl:value-of select="current()/@ows_Body" />
                      </div>
                      <xsl:if test="current()/@ows_Video0 != ''">
                        <script language="javascript">
                          /************** Player Video ************/
                          var vp4 = {
                          VIDEO: '<xsl:value-of select="current()/@ows_Video0"/>',
                          OSTER: '<xsl:value-of select="current()/@ows_Title"/>',
                          IMAGE: '<xsl:value-of select="Avanade:FormatLink(current()/@ows_Photo)"/>'
                          }
                        </script>
                        <div style="margin-bottom:15px; text-align:center">
                          <div id="player">Loading the player...</div>
                          <style type="text/css">
                            #player_wrapper{ margin:auto }
                          </style>
                          <script type="text/javascript" src="/_layouts/VPLink2014/Common/JS/playStreaming.js"></script>
                        </div>
                      </xsl:if>
                      <div style="font-family:Arial;font-size:10pt;color:#4f4f4f">
                        <xsl:value-of select="current()/@ows_Body2" />
                      </div>
                    </xsl:if>
                    <xsl:if test="current()/@ows_ProgId = '3579;#'">
                      <div WebPartID="1be32ca0-8723-4641-b507-d7cf2db237f4" HasPers="false" id="WebPartWPQ2" class="ms-WPBody" allowDelete="false" style="width:1000px;height:710px;overflow:hidden;" >
                        <iframe title="Show Me What You Got" frameBorder="0" id="MSOPageViewerWebPart_WebPartWPQ2" name="MSOPageViewerWebPart_WebPartWPQ2" width="100%" height="100%" src="http://crea.vente-privee.com/SMWUG/index_vplink.php" ddf_src="http://crea.vente-privee.com/SMWUG/S01E03/index_vplink.html">
                          <div class="UserGeneric">Le navigateur actuel ne prend pas en charge les pages qui contiennent l&#39;élément IFRAME. Pour utiliser ce composant WebPart, vous devez avoir recours à un navigateur qui prend en charge cet élément, tel que Microsoft Internet Explorer version 5 ou ultérieure.</div>
                        </iframe>
                      </div>
                    </xsl:if>
                    <xsl:if test="normalize-space(translate(current()/@ows_Compl_x00e9_ment_x0020_info, ',', '')) != ''">
                      <p>
                        <div style="font-family:Arial;font-size:10pt;color:#4f4f4f">
                          <xsl:value-of select="Avanade:FormatBody(current()/@ows_Compl_x00e9_ment_x0020_info)" />
                        </div>
                      </p>
                    </xsl:if>

                    <xsl:if test="/xml/ImageHaut01 or /xml/ImageHaut02 or /xml/ImageHaut03 or /xml/ImageHaut04
				or /xml/ImageBas01 or /xml/ImageBas02 or /xml/ImageBas03 or /xml/ImageBas04
				or /xml/ImageBas11 or /xml/ImageBas12 or /xml/ImageBas13 or /xml/ImageBas14">

                      <table cellspacing="0" cellpadding="0">
                        <xsl:if test="/xml/ImageHaut01 or /xml/ImageHaut02 or /xml/ImageHaut03 or /xml/ImageHaut04">
                          <tr>
                            <td>
                              <table width="100%" align="center" cellspacing="1px" cellpadding="1px">
                                <tr>
                                  <xsl:if test="/xml/ImageHaut01">
                                    <td>
                                      <img border="0" src="{/xml/ImageHaut01}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageHaut02">
                                    <td>
                                      <img border="0" src="{/xml/ImageHaut02}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageHaut03">
                                    <td>
                                      <img border="0" src="{/xml/ImageHaut03}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageHaut04">
                                    <td>
                                      <img border="0" src="{/xml/ImageHaut04}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </xsl:if>
                        <xsl:if test="/xml/ImageBas01 or /xml/ImageBas02 or /xml/ImageBas03 or /xml/ImageBas04">
                          <tr>
                            <td>
                              <table width="100%" align="center" cellspacing="1px" cellpadding="1px">
                                <tr>
                                  <xsl:if test="/xml/ImageBas01">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas01}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageBas02">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas02}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageBas03">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas03}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageBas04">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas04}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </xsl:if>
                        <xsl:if test="/xml/ImageBas11 or /xml/ImageBas12 or /xml/ImageBas13 or /xml/ImageBas14">
                          <tr>
                            <td>
                              <table width="100%" align="center" cellspacing="1px" cellpadding="1px">
                                <tr>
                                  <xsl:if test="/xml/ImageBas11">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas11}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageBas12">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas12}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageBas13">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas13}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                  <xsl:if test="/xml/ImageBas14">
                                    <td>
                                      <img border="0" src="{/xml/ImageBas14}" style="margin: 0 0 6px 6px"/>
                                    </td>
                                  </xsl:if>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </xsl:if>
                      </table>
                    </xsl:if>
                  </div>
                </div>
                <br/>
                <br/>
                <br/>
                <xsl:if test="Avanade:GetMediaType(current()/@ows_Media) = 'video'">
                  <script type="text/javascript" src="/_layouts/1036/swfobjectRefonteVPLink2013.js"></script>
                  <div id="video_auto_6Container" style="align:center">You need the Flash Player version 8.0.0.0 or higher and a JavaScript enabled browser to view this site</div>
                  <script type="text/javascript">
                    <xsl:if test="current()/@ows_Taille_x0020_video='Large'">
                      setVideoSize(850,478);
                    </xsl:if>
                    createPlayer('<xsl:value-of select="Avanade:FormatLink(current()/@ows_Media)" />');
                  </script>
                </xsl:if>
                <xsl:if test="Avanade:GetMediaType(current()/@ows_Media) = 'picture'">
                  <img style="border:solid 1px #fce4ee;">
                    <xsl:attribute name="src">
                      <xsl:value-of select="Avanade:FormatLink(current()/@ows_Media)" />
                    </xsl:attribute>
                  </img>
                </xsl:if>
              </div>
            </div>
          </td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>
</xsl:stylesheet>